/**
 * 2018年5月20日下午7:08:42
 */
package com.an.nopro.app.framework.schedulejob;

import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;

import javax.annotation.PostConstruct;
import javax.persistence.PostPersist;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean;
import org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

/**

 * @目的：定义配置.<br>
 * 
 * @author 86171
 * @date 2018年5月20日下午7:08:42
 * H
 */
@Configuration
public class MySchedulingConfigurer implements SchedulingConfigurer {
	
	@Autowired
	private ThreadPoolTaskScheduler threadPoolTaskScheduler;
	
	@PostConstruct
	public void threadPoolTaskSchedulerPre() {
		threadPoolTaskScheduler.setThreadNamePrefix("xianchen线程：");
		threadPoolTaskScheduler.setPoolSize(40);
	}
	
	/*@Bean
	public ScheduledExecutorService bean() {
		ScheduledExecutorFactoryBean beans = new ScheduledExecutorFactoryBean();
		beans.setPoolSize(20);
		beans.setThreadNamePrefix("ding定时任务线程池");
		return beans.getObject();
	}
	*/
	public Executor getScheduleExcutor() {
		return null;
//		sche
	}

	@Override
	public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
	}
	
	

}
